package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.ActivityTaskUserPrize;
import com.sc.nft.mapper.ActivityTaskUserPrizeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;


@Slf4j
@Repository
public class ActivityTaskUserPriceDao extends ServiceImpl<ActivityTaskUserPrizeMapper, ActivityTaskUserPrize> {


    public List<ActivityTaskUserPrize> getByTaskPlanId(Long planId){
        LambdaQueryWrapper<ActivityTaskUserPrize> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ActivityTaskUserPrize::getActivityPlanId,planId);
        wrapper.orderByDesc(ActivityTaskUserPrize::getCreateTime);
        return list(wrapper);
    }
}